<template>
  <div class="consult">
    <div class="consult-title">{{queryRow.title}}</div>
    <div class="consult-intro">{{queryRow.intro}}</div>
    <div class="consult-time">{{queryRow.createtime}}</div>

    <div class="consult-content" v-html="detailMsg"></div>
  </div>
</template>

<script setup>
import {ref,reactive,nextTick,onMounted } from 'vue';
import {onLoad, onShow} from "@dcloudio/uni-app";
import {getConsultDetail} from '@/api/home'

let query = reactive({})
let queryRow = reactive({})
let detailMsg =ref('')
const getDetails = (row) => {
    query = Object.assign(query,{
      id:row
    })
    getConsultDetail(query).then(res=>{
      if(res.data.code == 200){
        nextTick(() => {
          detailMsg = res.data.data.content;
          console.log(detailMsg)
        })

      }
    }).catch(err=>{})
}

onShow(async ()=>{
  getDetails(queryRow.id);
})

onLoad(async (options)=>{
  queryRow = JSON.parse(options.data)

})

</script>


<style lang="scss" scoped>
.consult{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .consult-title{
    font-size: 20px;
  }
  .consult-intro{
    font-size: 16px;
    margin: 0.5rem 0px;
    color: #2c405a;
  }
  .consult-time{
    font-size: 14px;
    color: #CBC4C4;
  }
  .consult-content{
    width: 90%;
    margin: 0 auto;
    font-size: 16px;
    padding-top: 10vw;
    box-sizing: border-box;
  }
}
</style>